/* eslint-disable @typescript-eslint/no-explicit-any */
/*
 *  Copyright 2021 Collate
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

 /**
 * 此模式定义了表查询结构
 */
export interface TableQuery {
    /**
     * SQL查询执行的日期
     */
    queries?: Array<any[] | boolean | number | number | null | TableQueryObject | string>;
}

export interface TableQueryObject {
    /**
     * 检查查询是否在执行过程中被中止的标志
     */
    aborted?: boolean;
    /**
     * SQL查询执行的日期
     */
    analysisDate?: Date;
    /**
     * 与查询中的表关联的数据库
     */
    databaseName?: string;
    /**
     * 与查询关联的数据库模式
     */
    databaseSchema?: string;
    /**
     * 查询运行时间，以秒为单位
     */
    duration?: number;
    /**
     * SQL查询执行的结束时间
     */
    endTime?: string;
    /**
     * 检查查询是否在处理使用时排除的标志
     */
    exclude_usage?: boolean;
    /**
     * SQL查询
     */
    query: string;
    /**
     * SQL查询类型
     */
    query_type?: string;
    /**
     * 标识此数据库服务的名称
     */
    serviceName: string;
    /**
     * SQL查询执行的开始时间
     */
    startTime?: string;
    /**
     * 执行SQL查询的用户的名称
     */
    userName?: string;
    [property: string]: any;
}
